package org.pangu.test.observer;

/**
 * @author zhangyj
 * @date 2022/7/13 0:48
 */
public class ObserverTestMain {
    public static void main(String[] args) {
        Subject subject = new OilSubject();

        Observer observer1 = new Observer1();
        Observer observer2 = new Observer2();

        subject.registerObserver(observer1);
        subject.registerObserver(observer2);

        subject.notify("油价上涨");
    }
}
